]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
capsLockWarning: Mark as not visible to a11y tree when hidden
authorLukáš Tyrychtr <ltyrycht@redhat.com>
Tue, 25 Nov 2025 14:26:09 +0000 (15:26 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 14 Jan 2026 18:00:13 +0000 (19:00 +0100)
We're animating it away, but not for the a11y tree.

This fixes it, so the caps lock warning is not read regardless of the state
of the key.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3981>
(cherry picked from commit ccd1a0b8f52e29ccd2356c5d2ac34e473b174cd0)

js/ui/shellEntry.js

index a69bffa5f60ed6b06160c2e3ad71c025d0943ec5..6cd15372758b3a3b8374862f5059586f26d0fad1 100644 (file)
@@ -1,3 +1,4 @@
+import Atk from 'gi://Atk';
 import Clutter from 'gi://Clutter';
 import GObject from 'gi://GObject';
 import Pango from 'gi://Pango';
@@ -202,6 +203,14 @@ class CapsLockWarning extends St.Label {
         let [, height] = this.get_preferred_height(-1);
         this.natural_height_set = naturalHeightSet;
 
+        if (capsLockOn) {
+            this.add_accessible_state(Atk.StateType.SHOWING);
+            this.add_accessible_state(Atk.StateType.VISIBLE);
+        } else {
+            this.remove_accessible_state(Atk.StateType.SHOWING);
+            this.remove_accessible_state(Atk.StateType.VISIBLE);
+        }
+
         this.ease({
             height: capsLockOn ? height : 0,
             opacity: capsLockOn ? 255 : 0,